<template>
  <div class="home">
    <div class="swiper01">
      <div class="swiper-container swiper1">
        <div class="swiper-wrapper">
          <div class="swiper-slide slide_1">
            1
          </div>
          <div class="swiper-slide slide_2">
            2
          </div>
          <div class="swiper-slide slide_3">
            3
          </div>
        </div>
        <div class="swiper-pagination"></div>
      </div>
    </div>
    <ul class="gezi">
      <li>
        <img src="../Common/images/contact.png" alt="">
        <span>新闻资讯</span>
        <router-link to="/newslist"></router-link>
      </li>
      <li>
        <img src="../Common/images/contact.png" alt="">
        <span>资讯</span>
      </li>
      <li>
        <img src="../Common/images/contact.png" alt="">
        <span>资讯</span>
      </li>
      <li>
        <img src="../Common/images/contact.png" alt="">
        <span>资讯</span>
      </li>
      <li>
        <img src="../Common/images/contact.png" alt="">
        <span>资讯</span>
      </li>
      <li>
        <img src="../Common/images/contact.png" alt="">
        <span>资讯</span>
      </li>
    </ul>
    <div class="vuex">
      {{this.$store.state.msg}}
      {{this.$store.state.count}}
      <input type="button" value="+" @click="actadd">
    </div>
  </div>
</template>

<script>
import Swiper from 'swiper'
import '../Common/css/swiper.css'
const axios = require('axios')
export default {
  methods: {
    getAlldata () {
      const data = new URLSearchParams()
      data.append('page', 1)
      data.append('pagesize', 2)
      data.append('gid', 27)
      axios.post('api/member.php?act=comment&ajax=true', data).then(e => {
        console.log(e)
      })
    },
    add () {
      return this.$store.commit('add', 2)
    },
    actadd () {
      return this.$store.dispatch('actadd', 2)
    }
  },
  created () {
    // this.getAlldata()
  },
  mounted () {
    var swiper1 = new Swiper('.swiper-container', {
      loop: true,
      pagination: {
        el: '.swiper-pagination'
      }
    })
  }
}
</script>

<style>
.home{
  width: 7.5rem;
  height: 10rem;
  margin: auto;
}
.swiper01{
  width: 7.5rem;
  height: 3rem;
}
.swiper1{
  width: 100%;
  height: 100%;
}
.swiper1 .swiper-slide{
  text-align: center;
  color: #ffffff;
  line-height: 3rem;
}
.swiper1 .slide_1{
  background-color: red;
}
.swiper1 .slide_2{
  background-color: yellow;
}
.swiper1 .slide_3{
  background-color: blue;
}
.gezi{
  width: 6.9rem;
  height: 3.5rem;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}
.gezi li{
  width: 2.3rem;
  height: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  position: relative;
}
.gezi li img{
  display: block;
  width: 1rem;
}
.gezi li span{
  font-size: 0.28rem;
  color: #222222;
}
.gezi li a{
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.vuex{
  width: 100%;
  height: auto;
  font-size: 0.28rem;
  color: #222222;
  text-align: center;
}
</style>
